const express=require('express');
const pageControllers=require('./albx_controllers/pageControllers')
const userControllers=require('./albx_controllers/userControllers')
const postsControllers=require('./albx_controllers/postsControllers')
let router=express.Router();
       //显示前台页面
router.get('/',pageControllers.getIndexPage)
      .get('/list',pageControllers.getListPage)
      .get('/detail',pageControllers.getDetailPage)

      //显示登录页面
      .get('/login',pageControllers.getAdminLoginPage)
      //显示后台页面
      .get('/admin/categories',pageControllers.getAdminCategoriesPage)
      .get('/admin/comments',pageControllers.getAdminCommentsPage)
      .get('/admin/index',pageControllers.getAdminIndexPage)
      .get('/admin/nav-menus',pageControllers.getAdminNavMenusPage)
      .get('/admin/password-resets',pageControllers.getAdminPasswordResetsPage)
      .get('/admin/post-add',pageControllers.getAdminPostAddPage)
      .get('/admin/posts',pageControllers.getAdminPostsPage)
      .get('/admin/profile',pageControllers.getAdminProfilePage)
      .get('/admin/settings',pageControllers.getAdminSettingsPage)
      .get('/admin/slides',pageControllers.getAdminSlidesPage)
      .get('/admin/users',pageControllers.getAdminUsersPage)

      //处理业务逻辑
      .post('/userLogin',userControllers.login)
      .get('/loginOut',userControllers.loginOut)
      //获取所有分类数据
      .get('/getAllCateList',postsControllers.getAllCateList)
module.exports=router;